package com.neo.servce.impl;

import com.neo.servce.UserService;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import static java.lang.Thread.sleep;

@Slf4j
@Service
public class UserServiceImpl implements UserService {

    @Override
    @SneakyThrows
    @Async("MyExecutor")
    public void insertUser() throws InterruptedException {
        sleep(2000);
        log.info("正在插入数据...");
    }

}

